package j2ee.mvc;

/**
 * @author yeyangtao
 * @date 2020/5/20 16:47
 */
public class StudentController {
    private StudentModel model;
    private StudentView view;

    public StudentController(StudentModel model, StudentView view) {
        this.model = model;
        this.view = view;
    }

    public String getStudentName() {
        return model.getName();
    }

    public void setStudentName(String name) {
        model.setName(name);
    }

    public Integer getStudentId() {
        return model.getId();
    }

    public void setStudentId(Integer id) {
        model.setId(id);
    }
    public void updateView(){
        view.printInfo(model.getName(),model.getId());
    }
}
